public class PrintNameThread implements Runnable {

	private Thread thread;
	private String prefix;
	private String suffix;
	private PrintStrings printStrings;

	public PrintNameThread(String name, String prefix, String suffix,
			PrintStrings printStrings) {
		setPrefix(prefix);
		setSoffix(suffix);
		setThread(new Thread(this, name));
		getThread().start();
		setPrintStrings(printStrings);

	}

	@Override
	public void run() {
		synchronized (getPrintStrings()) {
			getPrintStrings().print(getPrefix(), getSuffix());
		}

	//	getPrintStrings().print(getPrefix(), getSuffix());
	}

	public Thread getThread() {
		return thread;
	}

	public void setThread(Thread thread) {
		this.thread = thread;
	}

	public String getPrefix() {
		return prefix;
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public String getSuffix() {
		return suffix;
	}

	public void setSoffix(String suffix) {
		this.suffix = suffix;
	}

	public PrintStrings getPrintStrings() {
		return printStrings;
	}

	public void setPrintStrings(PrintStrings printStrings) {
		this.printStrings = printStrings;
	}

}
